package com.lagou.rpc.consumer.controller;


import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.anno.RpcReference;
import com.lagou.rpc.pojo.User;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/search")
public class RpcClientController {
    @RpcReference
    IUserService userService;

    @RequestMapping("/{id}")
    public User getUserById(@PathVariable int id) {
        return userService.getById(id);
    }
}
